package main

import (
	"bufio"
	"fmt"
	"net/http"
	"net/url"
)

func main() {
	baseUrl, err := url.Parse("https://qms-uat.kdlins.com.cn/cms/agy/orphan/undertake/list")
	if err != nil {
		fmt.Println("Malformed URL: ", err.Error())
		return
	}
	params := url.Values{}
	params.Add("operator", "admin")
	params.Add("transId", "12323123512341")

	baseUrl.RawQuery = params.Encode()

	resp, err := http.Get(baseUrl.String())
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	fmt.Println("Response status:", resp.Status)
	scanner := bufio.NewScanner(resp.Body)

	for i := 0; scanner.Scan() && i < 10; i++ {
		fmt.Println(scanner.Text())
	}
	if err := scanner.Err(); err != nil {
		panic(err)
	}
}
